package com.example.text.mapper;



import com.example.text.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface UserMapper  {

    @Select("select * from user")
    List<User> findALL();

    @Select("select * from user where id=#{id}")
    List<User> findById(String id);

    @Insert("insert into user(id,password) values (#{id},#{password}")
    int insert (User user);

    @Delete("delete from user where id =#{id}")
    int deleteById(Integer id);

    @Select("select * from user where id=#{id} and password=#{password}")
    User findOne(User user);




}
